<!DOCTYPE html>
<html lang="en">

	<head>
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<meta charset="utf-8" />
		<title>个人信息</title>

		<meta name="description" content="3 styles with inline editable feature" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />

		<!-- bootstrap & fontawesome -->
		<link rel="stylesheet" href="/assets/css/bootstrap.min.css" />
		<link rel="stylesheet" href="/assets/font-awesome/4.5.0/css/font-awesome.min.css" />

		<!-- page specific plugin styles -->
		<link rel="stylesheet" href="/assets/css/jquery-ui.custom.min.css" />
		<link rel="stylesheet" href="/assets/css/jquery.gritter.min.css" />
		<link rel="stylesheet" href="/assets/css/select2.min.css" />
		<link rel="stylesheet" href="/assets/css/bootstrap-datepicker3.min.css" />
		<link rel="stylesheet" href="/assets/css/bootstrap-editable.min.css" />

		<!-- text fonts -->
		<link rel="stylesheet" href="/assets/css/fonts.googleapis.com.css" />

		<!-- ace styles -->
		<link rel="stylesheet" href="/assets/css/ace.min.css" class="ace-main-stylesheet" id="main-ace-style" />

		<!--[if lte IE 9]>
			<link rel="stylesheet" href="/assets/css/ace-part2.min.css" class="ace-main-stylesheet" />
		<![endif]-->
		<link rel="stylesheet" href="/assets/css/ace-skins.min.css" />
		<link rel="stylesheet" href="/assets/css/ace-rtl.min.css" />

		<!--[if lte IE 9]>
		  <link rel="stylesheet" href="/assets/css/ace-ie.min.css" />
		<![endif]-->

		<!-- inline styles related to this page -->

		<!-- ace settings handler -->
		<script src="/assets/js/ace-extra.min.js"></script>

		<!-- HTML5shiv and Respond.js for IE8 to support HTML5 elements and media queries -->

		<!--[if lte IE 8]>
		<script src="/assets/js/html5shiv.min.js"></script>
		<script src="/assets/js/respond.min.js"></script>
		<![endif]-->
	</head>

	<body class="no-skin">
		<div id="navbar" class="navbar navbar-default          ace-save-state">
			<div class="navbar-container ace-save-state" id="navbar-container">
				<button type="button" class="navbar-toggle menu-toggler pull-left" id="menu-toggler" data-target="#sidebar">
					<span class="sr-only">Toggle sidebar</span>

					<span class="icon-bar"></span>

					<span class="icon-bar"></span>

					<span class="icon-bar"></span>
				</button>

				<div class="navbar-header pull-left">
					<a href="/views/index.html" class="navbar-brand">
						<small>
							<i class="fa fa-leaf"></i>
							学生发展数据综合评价与分析系统
						</small>
					</a>
				</div>

				<div class="navbar-buttons navbar-header pull-right" role="navigation">
					<ul class="nav ace-nav">
						<li class="light-blue dropdown-modal">
							<a data-toggle="dropdown" href="#" class="dropdown-toggle">

								<img class="nav-user-photo us_photo" src="/assets/images/avatars/blank.jpg" alt="个人头像" style="background-color:#fff" />

								<span class="user-info">
							       <span id="us_name"></span>
								</span>

								<i class="ace-icon fa fa-caret-down"></i>
							</a>

							<ul class="user-menu dropdown-menu-right dropdown-menu dropdown-yellow dropdown-caret dropdown-close">
								<li>
									<a id="setting" target="_blank">
										<i class="ace-icon fa fa-cog"></i> 设置
									</a>
								</li>

								<li>
									<a id="profile" target="_blank">
										<i class="ace-icon fa fa-user"></i> 个人信息
									</a>
								</li>

								<li class="divider"></li>

								<li>
									<a href="/login.html" onclick="logout()">
										<i class="ace-icon fa fa-power-off"></i> 注销
									</a>
								</li>
							</ul>
						</li>
					</ul>
				</div>
			</div>
			<!-- /.navbar-container -->
		</div>

		<div class="main-container ace-save-state" id="main-container">
			<script type="text/javascript">
				try {
					ace.settings.loadState('main-container')
				} catch(e) {}
			</script>

			<div id="sidebar" class="sidebar                  responsive                    ace-save-state">
				<script type="text/javascript">
					try {
						ace.settings.loadState('sidebar')
					} catch(e) {}
				</script>

				<div class="sidebar-shortcuts" id="sidebar-shortcuts">
					<div class="sidebar-shortcuts-large" id="sidebar-shortcuts-large">
						<button class="btn btn-success">
							<i class="ace-icon fa fa-signal"></i>
						</button>

						<button class="btn btn-info">
							<i class="ace-icon fa fa-pencil"></i>
						</button>

						<button class="btn btn-warning">
							<i class="ace-icon fa fa-users"></i>
						</button>

						<button class="btn btn-danger">
							<i class="ace-icon fa fa-cogs"></i>
						</button>
					</div>

					<div class="sidebar-shortcuts-mini" id="sidebar-shortcuts-mini">
						<span class="btn btn-success"></span>

						<span class="btn btn-info"></span>

						<span class="btn btn-warning"></span>

						<span class="btn btn-danger"></span>
					</div>
				</div>
				<!-- /.sidebar-shortcuts -->

				<ul class="nav nav-list">
					<li class="">
						<a href="/views/index.html">
							<i class="menu-icon fa fa-tachometer"></i>
							<span class="menu-text"> 我的首页 </span>
						</a>

						<b class="arrow"></b>
					</li>
				</ul>
				<!-- /.nav-list -->

				<div class="sidebar-toggle sidebar-collapse" id="sidebar-collapse">
					<i id="sidebar-toggle-icon" class="ace-icon fa fa-angle-double-left ace-save-state" data-icon1="ace-icon fa fa-angle-double-left" data-icon2="ace-icon fa fa-angle-double-right"></i>
				</div>
			</div>

			<div class="main-content">
				<div class="main-content-inner">
					<div class="breadcrumbs ace-save-state" id="breadcrumbs">
						<ul class="breadcrumb">
							<li>
								<i class="ace-icon fa fa-home home-icon"></i>
								<a href="#">我的首页</a>
							</li>

							<li class="active">个人信息</li>
						</ul>
						<!-- /.breadcrumb -->

					</div>

					<div class="page-content">

						<div class="row">
							<div class="col-xs-12">
								<!-- PAGE CONTENT BEGINS -->
								<div class="clearfix">
									<div style="height: 40px;"></div>

								</div>

								<div class="hr dotted"></div>

								<div>
									<div id="user-profile-1" class="user-profile row">
										<div class="col-xs-12 col-sm-3 center">
											<div>
												<span class="profile-picture">
													<img class="editable img-responsive us_photo_judge" src="/assets/images/avatars/blank.jpg" alt="头像" width="150px" height="150px"/>
												</span>

												<div class="space-4"></div>

												<div class="width-80 label label-info label-xlg arrowed-in arrowed-in-right">
													<div class="inline position-relative">
														<a href="#" class="user-title-label dropdown-toggle" data-toggle="dropdown">
															<i class="ace-icon fa fa-circle light-green"></i> &nbsp;
															<span class="white" id="p_name" style="font-size: 15px;"></span>
														</a>
													</div>
												</div>
											</div>

											<div class="space-6"></div>

											<div class="profile-contact-info">
												<div class="profile-contact-links center">
													<a class="btn btn-link" href="javascript:void(0)" onclick="sendMessage()">
														<i class="orange fa fa-comment bigger-120"></i> 发送消息
													</a>

												</div>

												<div class="space-6"></div>

											</div>

											<div class="hr hr12 dotted"></div>
											<div class="clearfix">
												<div class="grid2">
													<span class="bigger-150 blue">QQ</span>
													<br/>
													<span id="p_qq" style="font-size: 15px;">...</span>
												</div>

												<div class="grid2 ">
													<span class="bigger-150 blue ">邮箱</span>
													<br/>
													<span id="p_email" style="font-size: 15px;">...</span>
												</div>
											</div>

											<div class="hr hr16 dotted"></div>
										</div>

										<div class="col-xs-12 col-sm-9">
											<div class="center">
												<span class="btn btn-app btn-sm btn-light no-hover">
													<span class="line-height-1 bigger-170 blue" id="p_view">...</span>

												<br />
												<span class="line-height-1 smaller-90">浏览次数</span>
												</span>

												<span class="btn btn-app btn-sm btn-grey no-hover">
													<span class="line-height-1 bigger-170" id="p_file_count">...</span>

												<br />
												<span class="line-height-1 smaller-90">贡献资料</span>
												</span>
											</div>

											<div class="space-12"></div>

											<div class="col-xs-12 col-sm-9">
												<div class="widget-box transparent">
													<div class="widget-header widget-header-small header-color-blue2">
														<h4 class="widget-title smaller">
													<i class="ace-icon fa fa-lightbulb-o bigger-120"></i>
														基础信息
												</h4>
													</div>

													<div class="widget-body">
														<div class="widget-main" style="margin-top: 10px;">
															<div class="profile-user-info profile-user-info-striped">

																<div class="profile-info-row">
																	<div class="profile-info-name" style="font-size: 16px;"> 工号 </div>

																	<div class="profile-info-value">
																		<span id="p_id" style="font-size: 16px;"></span>
																	</div>
																</div>

																<div class="profile-info-row">
																	<div class="profile-info-name" style="font-size: 16px;"> 性别 </div>

																	<div class="profile-info-value">
																		<span id="p_sex" style="font-size: 16px;"></span>
																	</div>
																</div>

																<div class="profile-info-row">
																	<div class="profile-info-name" style="font-size: 16px;"> 部门 </div>

																	<div class="profile-info-value">
																		<span id="p_department" style="font-size: 16px;"></span>
																	</div>
																</div>

																<div class="profile-info-row">
																	<div class="profile-info-name" style="font-size: 16px;">学历</div>

																	<div class="profile-info-value">
																		<span id="p_edu_background" style="font-size: 16px;"></span>
																	</div>
																</div>

																<div class="profile-info-row">
																	<div class="profile-info-name" style="font-size: 16px;">职称</div>

																	<div class="profile-info-value">
																		<span id="p_pro_title" style="font-size: 16px;"></span>
																	</div>
																</div>

																<div class="profile-info-row">
																	<div class="profile-info-name" style="font-size: 16px;">政治面貌</div>

																	<div class="profile-info-value">
																		<span id="p_politics_status" style="font-size: 16px;"></span>
																	</div>
																</div>

															</div>
														</div>
													</div>
												</div>
											</div>

											<div class="space-20"></div>

											<div class="hr hr2 "></div>

											<div class="space-6"></div>

										</div>

									</div>

									<div class="row">
										<div class="col-xs-12 col-sm-6">
											<div class="widget-box transparent">
												<div class="widget-header widget-header-small">
													<h4 class="widget-title smaller">
														<i class="ace-icon fa fa-check-square-o bigger-110"></i>
															我的简介
													</h4>
												</div>

												<div class="widget-body">
													<div class="widget-main" id="p_intro" style="font-size: 16px;">

													</div>
												</div>
											</div>
										</div>
									</div>
								</div>

								<!-- PAGE CONTENT ENDS -->
							</div>
							<!-- /.col -->
						</div>
						<!-- /.row -->
					</div>
					<!-- /.page-content -->
				</div>
			</div>
			<!-- /.main-content -->

			<div class="footer">
				<div class="footer-inner">
					<div class="footer-content">
						<span class="bigger-120">
							<span class="blue bolder" style="margin-right: 10px;">学生发展数据综合评价与分析系统</span> 苏州科技大学 &copy; 2018-2019
						</span>
					</div>
				</div>
			</div>

			<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
				<i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
			</a>
		</div>
		<!-- /.main-container -->

		<!-- basic scripts -->

		<!--[if !IE]> -->
		<script src="/assets/js/jquery-2.1.4.min.js"></script>
		<script src="/assets/js/jquery.cookie.js"></script>
		<script src="/assets/js/sddb.util.js"></script>

		<!-- <![endif]-->

		<!--[if IE]>
<script src="/assets/js/jquery-1.11.3.min.js"></script>
<![endif]-->
		<script type="text/javascript">
			if('ontouchstart' in document.documentElement) document.write("<script src='/assets/js/jquery.mobile.custom.min.js'>" + "<" + "/script>");
		</script>
		<script src="/assets/js/bootstrap.min.js"></script>

		<!-- page specific plugin scripts -->

		<!--[if lte IE 8]>
		  <script src="/assets/js/excanvas.min.js"></script>
		<![endif]-->
		<script src="/assets/js/jquery-ui.custom.min.js"></script>
		<script src="/assets/js/jquery.ui.touch-punch.min.js"></script>
		<script src="/assets/js/jquery.gritter.min.js"></script>
		<script src="/assets/js/bootbox.js"></script>
		<script src="/assets/js/jquery.easypiechart.min.js"></script>
		<script src="/assets/js/bootstrap-datepicker.min.js"></script>
		<script src="/assets/js/jquery.hotkeys.index.min.js"></script>
		<script src="/assets/js/bootstrap-wysiwyg.min.js"></script>
		<script src="/assets/js/select2.min.js"></script>
		<script src="/assets/js/spinbox.min.js"></script>
		<script src="/assets/js/bootstrap-editable.min.js"></script>
		<script src="/assets/js/ace-editable.min.js"></script>
		<script src="/assets/js/jquery.maskedinput.min.js"></script>

		<!-- ace scripts -->
		<script src="/assets/js/ace-elements.min.js"></script>
		<script src="/assets/js/ace.min.js"></script>

		<!-- inline scripts related to this page -->

		<!--获取用户头像-->
		<script>
			jQuery(function($) {
				$.ajax({
					type: "get",
					url: "/user/getPhoto/" + window.location.href.split("=")[1],
					success: function(data) {
						if(data == null || data == "") {
							$(".us_photo_judge").attr("src", "/assets/images/avatars/user.jpg");
						} else {
							$(".us_photo_judge").attr("src", "/user/getPhoto/" + window.location.href.split("=")[1]);
						}
					},
					error: function(err) {
						alert(err);
					}

				});

			});
		</script>

		<script>
			function sendMessage() {
				window.open("/views/leaveMessage/leave.html?st_id=" + window.location.href.split("=")[1], "_blank");
			}
		</script>

		<!--获取用户主页资料(无gpa)-->
		<script>
			jQuery(function($) {
				$.ajax({
					type: "post",
					url: "/user/getTeacherProfile",
					dataType: "json",
					data: {
						"us_id": window.location.href.split("=")[1]
					},
					success: function(data) {
						$("#p_id").text(data.p_id);
						$("#p_name").text(data.p_name);
						$("#p_sex").text(data.p_sex);
						$("#p_department").text(data.p_department);
						$("#p_edu_background").text(data.p_edu_background);
						$("#p_pro_title").text(data.p_pro_title);
						$("#p_politics_status").text(data.p_politics_status);

						$("#p_view").text(data.p_view);
						$("#p_file_count").text(data.p_file_count);

						$("#p_qq").text(data.p_qq);
						$("#p_email").text(data.p_email);

						$("#p_intro").text(data.p_intro);

					},
					error: function(err) {

					}
				});
			});
		</script>

		<!--增加访问数-->
		<script>
			$.ajax({
				type: "post",
				url: "/user/addVisitNumber",
				dataType: "json",
				data: {
					"from": $.cookie("us_id"),
					"to": window.location.href.split("=")[1]
				},
				success: function(data) {

				},
				error: function(err) {

				}
			});
		</script>

		<script type="text/javascript">
			jQuery(function($) {

				//editables on first profile page
				$.fn.editable.defaults.mode = 'inline';
				$.fn.editableform.loading = "<div class='editableform-loading'><i class='ace-icon fa fa-spinner fa-spin fa-2x light-blue'></i></div>";
				$.fn.editableform.buttons = '<button type="submit" class="btn btn-info editable-submit"><i class="ace-icon fa fa-check"></i></button>' +
					'<button type="button" class="btn editable-cancel"><i class="ace-icon fa fa-times"></i></button>';

				//select2 editable
				var countries = [];
				$.each({
					"CA": "Canada",
					"IN": "India",
					"NL": "Netherlands",
					"TR": "Turkey",
					"US": "United States"
				}, function(k, v) {
					countries.push({
						id: k,
						text: v
					});
				});

				var cities = [];
				cities["CA"] = [];
				$.each(["Toronto", "Ottawa", "Calgary", "Vancouver"], function(k, v) {
					cities["CA"].push({
						id: v,
						text: v
					});
				});
				cities["IN"] = [];
				$.each(["Delhi", "Mumbai", "Bangalore"], function(k, v) {
					cities["IN"].push({
						id: v,
						text: v
					});
				});
				cities["NL"] = [];
				$.each(["Amsterdam", "Rotterdam", "The Hague"], function(k, v) {
					cities["NL"].push({
						id: v,
						text: v
					});
				});
				cities["TR"] = [];
				$.each(["Ankara", "Istanbul", "Izmir"], function(k, v) {
					cities["TR"].push({
						id: v,
						text: v
					});
				});
				cities["US"] = [];
				$.each(["New York", "Miami", "Los Angeles", "Chicago", "Wysconsin"], function(k, v) {
					cities["US"].push({
						id: v,
						text: v
					});
				});

				var currentValue = "NL";
				$('#country').editable({
					type: 'select2',
					value: 'NL',
					//onblur:'ignore',
					source: countries,
					select2: {
						'width': 140
					},
					success: function(response, newValue) {
						if(currentValue == newValue) return;
						currentValue = newValue;

						var new_source = (!newValue || newValue == "") ? [] : cities[newValue];

						//the destroy method is causing errors in x-editable v1.4.6+
						//it worked fine in v1.4.5
						/**			
						$('#city').editable('destroy').editable({
							type: 'select2',
							source: new_source
						}).editable('setValue', null);
						*/

						//so we remove it altogether and create a new element
						var city = $('#city').removeAttr('id').get(0);
						$(city).clone().attr('id', 'city').text('Select City').editable({
							type: 'select2',
							value: null,
							//onblur:'ignore',
							source: new_source,
							select2: {
								'width': 140
							}
						}).insertAfter(city); //insert it after previous instance
						$(city).remove(); //remove previous instance

					}
				});

				$('#city').editable({
					type: 'select2',
					value: 'Amsterdam',
					//onblur:'ignore',
					source: cities[currentValue],
					select2: {
						'width': 140
					}
				});

				//custom date editable
				$('#signup').editable({
					type: 'adate',
					date: {
						//datepicker plugin options
						format: 'yyyy/mm/dd',
						viewformat: 'yyyy/mm/dd',
						weekStart: 1

						//,nativeUI: true//if true and browser support input[type=date], native browser control will be used
						//,format: 'yyyy-mm-dd',
						//viewformat: 'yyyy-mm-dd'
					}
				})

				$('#age').editable({
					type: 'spinner',
					name: 'age',
					spinner: {
						min: 16,
						max: 99,
						step: 1,
						on_sides: true
						//,nativeUI: true//if true and browser support input[type=number], native browser control will be used
					}
				});

				$('#login').editable({
					type: 'slider',
					name: 'login',

					slider: {
						min: 1,
						max: 50,
						width: 100
						//,nativeUI: true//if true and browser support input[type=range], native browser control will be used
					},
					success: function(response, newValue) {
						if(parseInt(newValue) == 1)
							$(this).html(newValue + " hour ago");
						else $(this).html(newValue + " hours ago");
					}
				});

				$('#about').editable({
					mode: 'inline',
					type: 'wysiwyg',
					name: 'about',

					wysiwyg: {
						//css : {'max-width':'300px'}
					},
					success: function(response, newValue) {}
				});

				//////////////////////////////
				$('#profile-feed-1').ace_scroll({
					height: '250px',
					mouseWheelLock: true,
					alwaysVisible: true
				});

				$('a[ data-original-title]').tooltip();

				//change profile
				$('[data-toggle="buttons"] .btn').on('click', function(e) {
					var target = $(this).find('input[type=radio]');
					var which = parseInt(target.val());
					$('.user-profile').parent().addClass('hide');
					$('#user-profile-' + which).parent().removeClass('hide');
				});

				/////////////////////////////////////
				$(document).one('ajaxloadstart.page', function(e) {
					//in ajax mode, remove remaining elements before leaving page
					try {
						$('.editable').editable('destroy');
					} catch(e) {}
					$('[class*=select2]').remove();
				});
			});
		</script>
	</body>

</html>